<%#
# To change this template, choose Tools | Templates
# and open the template in the editor.
%>

<% form_for :election, @election, :url=>{:action=>"update_election"} do | f |%>
  ID:  <%= (@election.id|| "new") %> <%= f.hidden_field :id %><br />
  Title: <%= f.text_field :name, "size"=>100 %><br />
  <% types = {"SimpleMajorityElection"=>"Simple Majority","RatingElection"=>"Rating", "ApprovalElection"=>"Approval"}
     options = ''
     types.each do | type, label |
       selected = nil
       selected = "SELECTED" if type == @election.class.to_s
       options << "<option value=\"#{type}\" #{selected}>#{label}</option>"
     end
  %>    
  Type: <%= select_tag "type", options %><br />
  Start time:  <%= calendar_date_select :election, :start_time, :time => true %><br />
  End time: <%= calendar_date_select :election, :end_time, :time => true %><br />
  Conditions:  <%= f.text_area :conditions, "cols"=>80, "rows"=>5 %>
  <%= submit_tag %>
<%end%>

